home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / GunSmoke.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.2 KB  |  48 lines

  1. class classes.fx.GunSmoke
  2. {
  3.    var id;
  4.    var x;
  5.    var y;
  6.    var clip;
  7.    var xMov;
  8.    var yMov;
  9.    var c;
  10.    var cMax;
  11.    var alphaStart;
  12.    var Name = "gunSmoke";
  13.    function GunSmoke(px, py, pid)
  14.    {
  15.       this.id = pid;
  16.       this.x = px;
  17.       this.y = py;
  18.       _root.d = _root.d + 1;
  19.       this.clip = _root.attachMovie("gunSmoke","gunSmoke" + this.id + "Clip",_root.d + 499990);
  20.       this.clip._x = this.x;
  21.       this.clip._y = this.y;
  22.       this.xMov = _root.randRange2(-0.5,0.5);
  23.       this.yMov = _root.randRange2(-1,-3);
  24.       this.c = 0;
  25.       this.cMax = _root.randRange(15,30);
  26.       this.alphaStart = _root.randRange(50,110);
  27.       var _loc3_ = _root.randRange2(0.7,1.2);
  28.       this.clip._xscale *= _loc3_;
  29.       this.clip._yscale *= _loc3_;
  30.    }
  31.    function main()
  32.    {
  33.       this.c = this.c + 1;
  34.       if(this.c == this.cMax)
  35.       {
  36.          _root.removeFX("gunSmoke" + this.id);
  37.       }
  38.       this.yMov *= 1.03;
  39.       this.clip._alpha = this.alphaStart - this.c * (this.alphaStart / this.cMax);
  40.       this.clip._xscale *= 1.04;
  41.       this.clip._yscale *= 1.04;
  42.       this.x += this.xMov;
  43.       this.y += this.yMov;
  44.       this.clip._x = this.x;
  45.       this.clip._y = this.y;
  46.    }
  47. }
  48.